WARNING: This program does not work the way we want it to! It has a logic error and we need to fix it!

The my_dictionary.get(key) command returns None, if the key isn't in the dictionary.

  • Click Run and Console. See how my_value equals None?
  • Fix the bug by adding the key "purple" with a value of 40 into rainbow_dictionary .
  • When finished, click Submit and Next to move on.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)